INSTALL_PATH=/usr/local/ccpm
BUILD_PATH=publish/ccpm
BIN_PATH=/usr/local/bin

build: 	
	pyinstaller -F ./index.spec 
	rm -r -f build
	mkdir -p $(BUILD_PATH)
	mv dist/index/* $(BUILD_PATH)
	rm -r -f dist

build_nuitka:
	nuitka3 --standalone  --show-progress  --output-dir=publish --python-flag=no_site index.py
	upx publish/index.dist/index
	mv publish/index.dist  $(BUILD_PATH)
	# bug issua
	# path in staticfiles for oss2 aliyunsdkcore/data not copy! must hand copy to bin's root path

install: 
	mkdir -p $(INSTALL_PATH)/lib
	cp -r -f $(BUILD_PATH)/* $(INSTALL_PATH)/lib
	cp -r -f bin $(INSTALL_PATH)/bin
	cp -r -f ./static $(INSTALL_PATH)
	ln -f $(INSTALL_PATH)/bin/ccpm  $(BIN_PATH)/ccpm

	echo "===============install suc==============="

clean:
	rm -r -f $(BUILD_PATH)